package com.zyy.smartcity1129.util;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;

public class PpUtil {

    public PopupWindow p;

    public View getP(Context c, int layId){

        View v= LayoutInflater.from(c).inflate(layId,null);
        p=new PopupWindow(v);
        p.setHeight(c.getResources().getDisplayMetrics().heightPixels);
        p.setWidth(c.getResources().getDisplayMetrics().widthPixels);
        p.setFocusable(true);
        p.showAtLocation(v, Gravity.CENTER,0,0);
        return v;

    }
    public void closeP(){
        if(p!=null){
            p.dismiss();
        }
    }

}